package com.situ.mall.base.util;


import com.situ.mall.base.entity.Member;


/**
 * ClassName: RequestUtil
 * Package: com.situ.store.util
 * Description:
 *
 * @Author Darling_达
 * @Create 2023-03-09 9:24
 * @Version 1.0
 */

// 前台服务 session工具类
public class OrderSessionUtil {

    private static final String CURRENT_MEMBER = "CURRENT_MEMBER";

    // 获取当前的登录会员对象
    public static Member getCurrent(){
        Object obj = RequestUtil.getSession().getAttribute(CURRENT_MEMBER);
        if (obj == null) {
            return null;
        }
        return (Member) obj;
    }

    // 登录的时候用
    public static void setCurrent(Member member){
        RequestUtil.getSession().setAttribute(CURRENT_MEMBER, member);
    }



}
